<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // function  fn(){
    //     let num  =10;
    //     let  fn1= ()=>{
    //         num++;
    //         alert(num);
    //     }
    //     return  fn1;
    // }

    // let  result = fn();//fn 执行完没有?
    // result();//11
    // result();//12
    // //思考一个问题  函数里面的东西什么时候清空

    // fn()();//11
    // fn()();//11

    function  useState(num){
        let  n  =num;
        let fn = (num)=>{
            n=num;
            alert(n);
        }
        return  [n,fn];

    }



    let  [num,setNum] = useState(10);

    setNum(99);


</script>
</html>